<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('wechat/menu')}">{:L('ADMIN_WXMENU_INDEX')}</a></li>
			<li><a href="{:U('wechat/menu_add')}">{:L('ADMIN_WXMENU_ADD')}</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="{:U('wechat/menu_post')}">
			<table class="table table-hover table-bordered table-list" id="menus-table">
				<thead>
					<tr>
						<th width="20%">{:L('NMAE')}</th>
						<th width="8%">{:L('TYPE')}</th>
						<th width="57%">{:L('VALUE')}</th>
						<th width="7%">{:L('ORDER')}</th>
						<th width="8%">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="pmenu" item="item">
						<tr>
							<td>{$item.name}</td>
							<td>
								<if condition="$item.type eq 1">命令
								<elseif condition="$item.type eq 3"/>自定义图文
								<else />链接</if>
							</td>
							<td>{$item.value}</td>
							<td>{$item.order}</td>
							<td>
								<a href="{:U('wechat/menu_edit',array('id'=>$item['id']))}">{:L('EDIT')}</a>|
								<a href="{:U('wechat/menu_delete',array('id'=>$item['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
							</td>
					  	</tr>
					  	<foreach name="item.menu" item="item">
							<tr>
								<td>|____{$item.name}</td>
								<td>
									<if condition="$item.type eq 1">命令
									<elseif condition="$item.type eq 3"/>自定义图文
									<else />链接</if>
								</td>
								<td>{$item.value}</td>
								<td>{$item.order}</td>
								<td>
									<a href="{:U('wechat/menu_edit',array('id'=>$item['id']))}">{:L('EDIT')}</a>|
									<a href="{:U('wechat/menu_delete',array('id'=>$item['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
								</td>
						  	</tr>
						</foreach>
					</foreach>
				</tbody>
			</table>
			<div class="table-actions" align="center">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit">{:L('SET_MENU')}</button>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		$(document).ready(function() {
			Wind.css('treeTable');
			Wind.use('treeTable', function() {
				$("#menus-table").treeTable({
					indent : 20
				});
			});
		});
	</script>
</body>
</html>